Skip to content

feat(i18n): localize the entire site into 15 languages#21

Merged
oratis merged 2 commits into
mainfrom
claude/exciting-leavitt-281534
Jun 15, 2026
Merged

feat(i18n): localize the entire site into 15 languages#21
oratis merged 2 commits into
mainfrom
claude/exciting-leavitt-281534

Conversation

@oratis

@oratis oratis commented Jun 15, 2026

Copy link
Copy Markdown
Owner

Adds a header language selector and full-site localization into 15 languages via next-intl.

Locales: English · 简体中文 · Español · العربية (RTL) · Français · Deutsch · 日本語 · 한국어 · Português · Русский · हिन्दी · Bahasa Indonesia · Tiếng Việt · Türkçe · Italiano.

What changed

  • Routing: sub-path with English unprefixed (/agents stays; others get /zh/agents, …) — no redirects for existing URLs. The app tree moved under src/app/[locale]/; the request interceptor is src/proxy.ts (Next 16 renamed middleware.tsproxy.ts). Config in src/i18n/{routing,navigation,request}.ts.
  • Strings: messages/<locale>.json — 20 namespaces, 551 keys each, with per-key English fallback. All visitor/account/admin pages + shared components localized. ICU plural/number formatting replaces {n} agent{s} concatenation. LocaleSwitcher preserves path + query.
  • SEO: per-locale <html lang>, hreflang + x-default on every page, localized og:locale, per-URL sitemap <xhtml:link> alternates, and prefixed-locale robots disallows.
  • RTL: Arabic via dir="rtl" + a physical→logical Tailwind sweep (ml→ms, text-left→text-start, …).
  • Not translated: DB-driven content (agent/skill/category names & descriptions) stays in its original language.
  • CI: scripts/check-i18n.mjs + a workflow that fails on locale key drift or invalid ICU. Run locally with npm run check:i18n.
  • Drive-by fix: src/app/mcp/route.ts wasn't awaiting checkRateLimit, so that endpoint's rate limiting was silently dead (and it blocked next build's type check).

Verification

  • next build green — 0 type errors, all 283 static pages generate.
  • All 15 locales return 200; all 8,265 message values pass the @formatjs ICU parser with full key parity (npm run check:i18n ✓).
  • Manually screenshotted home/agents/skills/install in EN/ZH/AR/JA/RU — translations render and Arabic mirrors correctly.

⚠️ Before merging / shipping

  • Translation review: en (source) and zh were hand-checked. The other 13 locales are AI-generated — complete, ICU-valid, and coherent, but recommend native-speaker review before treating them as production-final.
  • Cosmetic: next build prints a metadataBase warning (×11) from the file-convention OG image during static gen; the rendered og:image is correct (https://takoapi.com/opengraph-image) — noise, not a defect.

🤖 Generated with Claude Code

oratis and others added 2 commits June 15, 2026 11:51
Add a header language switcher and full-site localization across 15
locales (en, zh, es, ar, fr, de, ja, ko, pt, ru, hi, id, vi, tr, it)
using next-intl with sub-path routing (English stays unprefixed).

- Move the app tree under src/app/[locale]/; add src/proxy.ts request
  interceptor (Next 16 renamed middleware -> proxy) and
  src/i18n/{routing,navigation,request}.ts. Strings live in
  messages/<locale>.json (20 namespaces, 551 keys each) with per-key
  English fallback.
- Localize all visitor/account/admin pages + shared components; ICU
  plural/number formatting replaces count-in-sentence concatenation;
  LocaleSwitcher preserves path + query when switching.
- SEO: per-locale <html lang>, hreflang + x-default, localized og:locale,
  per-locale sitemap alternates, prefixed-locale robots disallows.
- RTL support for Arabic (dir + logical Tailwind utilities).
- DB-driven content (agent/skill/category text) intentionally untranslated.
- en + zh hand-checked; the other 13 locales are AI-translated
  (ICU-validated + key-parity-checked) and should get native review
  before being treated as production-final.
- Add scripts/check-i18n.mjs + a CI workflow that fails on locale key
  drift or invalid ICU.
- Fix a pre-existing bug: src/app/mcp/route.ts wasn't awaiting
  checkRateLimit, so that endpoint's rate limiting never triggered.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
next-intl needs @swc/helpers@0.5.23 as a nested dependency (next pins
0.5.15 at the top level). The lock generated locally with npm 11 omitted
that nested node, which npm 10 rejects — breaking `npm ci` in both the new
i18n CI workflow and the Dockerfile (node:20-alpine). Regenerated the lock
inside node:20-alpine so `npm ci` succeeds in the deploy environment.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@oratis oratis merged commit a2ef242 into main Jun 15, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant